package com.example.lxrbf.db;

import android.content.Context;
import android.database.sqlite.*;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.util.Log;

public class MySQLiteOpenHelper extends SQLiteOpenHelper{

	public MySQLiteOpenHelper(Context context, String name, CursorFactory factory, int version) {
		super(context, name, factory, version);
		//super(context,"database.db",null,version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		//db.execSQL("CREATE TABLE table1(id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT UNIQUE,phone TEXT UNIQUE)");
		db.execSQL(	"CREATE TABLE "+MySQLiteController.tablename+
				"(id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT UNIQUE,"+
				"phone1 TEXT,"+"phone2 TEXT,"+"phone3 TEXT,"+"phone4 TEXT,"+
				"phone5 TEXT,"+"phone6 TEXT,"+"phone7 TEXT,"+"phone8 TEXT"+
				")");
		//Log.d("mytag", "hp onCreate");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		//db.execSQL("CREATE TABLE lianxiren(id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT,phone INTEGER)");
		//Log.d("mytag", "hp onUpgrade");
	}
}
